<template>
	<view class="home-fourF">
		<view class="sige">
			<!-- 设备 -->
			<view @click="goshe">
			<image src="../../static/imgs/shebei.png" mode="" ></image>
				<view class="sigezisb">{{$t('home.four.shebei')}}</view>
			</view>
			
			<!-- 收益 -->
			<view @click="getMoney">
			<image src="../../static/imgs/sy.png" mode="" ></image>
				<view class="sigezisy">{{$t('home.four.profit')}}</view>
			</view>
			
			<!-- 算力 -->
			<view @click="goComp">
			<image src="../../static/imgs/sl.png" mode="" ></image>
				<view class="sigezisl">{{$t('home.four.comPower')}}</view>
			</view>
			
			<!-- 计算器 -->
			<view @click="profitCount">
			<image src="../../static/imgs/jsq.png" mode="" ></image>
				<view class="sigezijsq">{{$t('home.four.Calculator')}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				localx:'',
				localy:'',
			}
		},
		methods:{
			goshe(){
				
				if(this.$store.state.istoken){
					uni.navigateTo({
						url:'../../pages/shebei/shebei'
					})
				}else{
					uni.showModal({
						icon:'none',
						title:'尚未登录，是否去登录？',
						success:res=>{
							if(res.confirm){
								uni.reLaunch({
									url:'../../pages/login/login'
								})
							}
						}
					})
				}
				
				
				// uni.getLocation({
				//     type: 'gcj02 ',
				//     success: function (res) {
				//         console.log('当前位置的经度：' + res.longitude);
				//         console.log('当前位置的纬度：' + res.latitude);
				// 		this.localx=res.longitude
				// 		this.localy=res.latitude
				
				// uni.chooseLocation({
				// 	latitude:res.latitude,
				// 	longitude:res.longitude,
				//     success: function (res2) {
				//         console.log('位置名称：' + res2.name);
				//         console.log('详细地址：' + res2.address);
				//         console.log('纬度：' + res2.latitude);
				//         console.log('经度：' + res2.longitude);
						
				//     }
				// })
				//     }
				// });
				
			},
			getMoney(){
				console.log(22);
				uni.switchTab({
					url:'../../pages/get/get'
				})
			},
			profitCount(){
				uni.navigateTo({
					url:'../../pages/profitCount/profitCount'
				})
			},
			goComp(){
				uni.navigateTo({
					url:'../../pages/computingPower/computingPower'
				})
			}
		}
	}
</script>

<style>
.sige {
		width: 94%;
		margin:  auto;
		margin-bottom: 20rpx;
		/* margin-left: 20px; */
		display: flex;
		flex-direction: row;
		justify-content: space-evenly;
		font-size: .8em;
	}
	
	.sige>view{
		width: 17%;
		height: 116rpx;
		text-align: center;
		/* background-color: #005FDB; */
	}
	.sige>view>image{
		width: 62%;
		height: 76rpx;
	}
	.sigezi {
		color: #0C1323;
		margin-top: 0px;
		font-weight: 550;
		opacity: .8;
		text-align: center;
	}
	/* .sigezisb{
		margin-left: 12px;
	}
	.sigezisy{
		margin-left: 12px;
	}
	.sigezisl{
		margin-left: 15px;
	}
	.sigezijsq{
		margin-left: 7px;
	} */
</style>
